package com.thirteen.app.service;

import com.thirteen.app.dto.CreateExamRequest.ExamDto;
import com.thirteen.app.dto.ExamConditionDto;
import com.thirteen.app.dto.ExamResponse.ExamListStudentDto;
import com.thirteen.app.dto.ExamResponse.ExamListTeacherDto;
import com.thirteen.app.dto.ExamResponse.SelectExamByUserDto;
import com.thirteen.app.dto.PaperListDto;
import com.thirteen.app.dto.PaperRespose.PaperDto;
import com.thirteen.app.entity.Exam;
import com.thirteen.app.utils.tools.CommonResult;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;
import java.util.Map;

public interface ExamService {

    //    开始考试
    Integer startExam(Integer examId, Integer userId);

    //    创建考试
    Boolean insertExam(ExamDto examDto);

    //    学生端查询考试
    List<ExamListStudentDto> queryAllExamStudent(ExamConditionDto examConditionDto);

    //    教师端查询考试
    List<ExamListTeacherDto> queryAllExamTeacher(ExamConditionDto examConditionDto);

    //      管理员审核考试
    Boolean judgeExamAuditAdmin(Integer paperId, Integer audit);

    //      老师提交审核考试
    Boolean applyExamAuditTeacher(Integer paperId);

    //        zql&ar
    PaperListDto getExamPaperList(Integer examId);

    //wc

//    通过Id查找考试
    Exam queryById(Integer examid);

//    管理员全查
    Map<String, Object> queryAllExamByLimit(String examName,String courseName,Integer offset, Integer limit);

    /**
     * 修改数据
     */
    boolean update(Exam exam);

    /**
     * 通过主键删除数据
     */
    boolean deleteById(Integer examid);

    int getExamCount();

    Map<String, Object> queryAllByTime(String beginTime, String endTime, String examName, Integer userId);

    List<SelectExamByUserDto> queryAllByUser(ExamConditionDto examConditionDto);

    String getType(Object o);


    //PaperDto paperConstituteRandom(Integer examId, Integer userId);

    boolean insertAnswerSet(PaperDto paperDTO, Integer examRecordId);


    Map<String, Object> queryAllByTeacherTime(String beginTime, String endTime, String examName, Integer userId);


    Map<String, Object> queryExamByName(String examName, Integer userId);

    boolean queryExamState(Integer examId, Integer userId);

    PaperDto getPaper(Integer examId, Integer examRecordId, Integer userId);

}
